﻿
namespace PPFinance.DataRia.Web
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Data;
    using System.Linq;
    using System.ServiceModel.DomainServices.EntityFramework;
    using System.ServiceModel.DomainServices.Hosting;
    using System.ServiceModel.DomainServices.Server;


    // Implements application logic using the PPFinanceEntities context.
    // TODO: Add your application logic to these methods or in additional methods.
    // TODO: Wire up authentication (Windows/ASP.NET Forms) and uncomment the following to disable anonymous access
    // Also consider adding roles to restrict access as appropriate.
    // [RequiresAuthentication]
    [EnableClientAccess()]
    public class DataDomainService : LinqToEntitiesDomainService<PPFinanceEntities>
    {

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Expenditure_Category' query.
        public IQueryable<Expenditure_Category> GetExpenditure_Category()
        {
            return this.ObjectContext.Expenditure_Category;
        }

        public void InsertExpenditure_Category(Expenditure_Category expenditure_Category)
        {
            if ((expenditure_Category.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(expenditure_Category, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Expenditure_Category.AddObject(expenditure_Category);
            }
        }

        public void UpdateExpenditure_Category(Expenditure_Category currentExpenditure_Category)
        {
            this.ObjectContext.Expenditure_Category.AttachAsModified(currentExpenditure_Category, this.ChangeSet.GetOriginal(currentExpenditure_Category));
        }

        public void DeleteExpenditure_Category(Expenditure_Category expenditure_Category)
        {
            if ((expenditure_Category.EntityState == EntityState.Detached))
            {
                this.ObjectContext.Expenditure_Category.Attach(expenditure_Category);
            }
            this.ObjectContext.Expenditure_Category.DeleteObject(expenditure_Category);
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Expenditure_Details' query.
        public IQueryable<Expenditure_Details> GetExpenditure_Details()
        {
            return this.ObjectContext.Expenditure_Details;
        }

        public void InsertExpenditure_Details(Expenditure_Details expenditure_Details)
        {
            if ((expenditure_Details.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(expenditure_Details, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Expenditure_Details.AddObject(expenditure_Details);
            }
        }

        public void UpdateExpenditure_Details(Expenditure_Details currentExpenditure_Details)
        {
            this.ObjectContext.Expenditure_Details.AttachAsModified(currentExpenditure_Details, this.ChangeSet.GetOriginal(currentExpenditure_Details));
        }

        public void DeleteExpenditure_Details(Expenditure_Details expenditure_Details)
        {
            if ((expenditure_Details.EntityState == EntityState.Detached))
            {
                this.ObjectContext.Expenditure_Details.Attach(expenditure_Details);
            }
            this.ObjectContext.Expenditure_Details.DeleteObject(expenditure_Details);
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Income_Category' query.
        public IQueryable<Income_Category> GetIncome_Category()
        {
            return this.ObjectContext.Income_Category;
        }

        public void InsertIncome_Category(Income_Category income_Category)
        {
            if ((income_Category.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(income_Category, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Income_Category.AddObject(income_Category);
            }
        }

        public void UpdateIncome_Category(Income_Category currentIncome_Category)
        {
            this.ObjectContext.Income_Category.AttachAsModified(currentIncome_Category, this.ChangeSet.GetOriginal(currentIncome_Category));
        }

        public void DeleteIncome_Category(Income_Category income_Category)
        {
            if ((income_Category.EntityState == EntityState.Detached))
            {
                this.ObjectContext.Income_Category.Attach(income_Category);
            }
            this.ObjectContext.Income_Category.DeleteObject(income_Category);
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Income_Details' query.
        public IQueryable<Income_Details> GetIncome_Details()
        {
            return this.ObjectContext.Income_Details;
        }

        public void InsertIncome_Details(Income_Details income_Details)
        {
            if ((income_Details.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(income_Details, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Income_Details.AddObject(income_Details);
            }
        }

        public void UpdateIncome_Details(Income_Details currentIncome_Details)
        {
            this.ObjectContext.Income_Details.AttachAsModified(currentIncome_Details, this.ChangeSet.GetOriginal(currentIncome_Details));
        }

        public void DeleteIncome_Details(Income_Details income_Details)
        {
            if ((income_Details.EntityState == EntityState.Detached))
            {
                this.ObjectContext.Income_Details.Attach(income_Details);
            }
            this.ObjectContext.Income_Details.DeleteObject(income_Details);
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Sys_Cards' query.
        public IQueryable<Sys_Cards> GetSys_Cards()
        {
            return this.ObjectContext.Sys_Cards;
        }

        public void InsertSys_Cards(Sys_Cards sys_Cards)
        {
            if ((sys_Cards.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(sys_Cards, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Sys_Cards.AddObject(sys_Cards);
            }
        }

        public void UpdateSys_Cards(Sys_Cards currentSys_Cards)
        {
            this.ObjectContext.Sys_Cards.AttachAsModified(currentSys_Cards, this.ChangeSet.GetOriginal(currentSys_Cards));
        }

        public void DeleteSys_Cards(Sys_Cards sys_Cards)
        {
            if ((sys_Cards.EntityState == EntityState.Detached))
            {
                this.ObjectContext.Sys_Cards.Attach(sys_Cards);
            }
            this.ObjectContext.Sys_Cards.DeleteObject(sys_Cards);
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Sys_Enchashment' query.
        public IQueryable<Sys_Enchashment> GetSys_Enchashment()
        {
            return this.ObjectContext.Sys_Enchashment;
        }

        public void InsertSys_Enchashment(Sys_Enchashment sys_Enchashment)
        {
            if ((sys_Enchashment.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(sys_Enchashment, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Sys_Enchashment.AddObject(sys_Enchashment);
            }
        }

        public void UpdateSys_Enchashment(Sys_Enchashment currentSys_Enchashment)
        {
            this.ObjectContext.Sys_Enchashment.AttachAsModified(currentSys_Enchashment, this.ChangeSet.GetOriginal(currentSys_Enchashment));
        }

        public void DeleteSys_Enchashment(Sys_Enchashment sys_Enchashment)
        {
            if ((sys_Enchashment.EntityState == EntityState.Detached))
            {
                this.ObjectContext.Sys_Enchashment.Attach(sys_Enchashment);
            }
            this.ObjectContext.Sys_Enchashment.DeleteObject(sys_Enchashment);
        }

        // TODO:
        // Consider constraining the results of your query method.  If you need additional input you can
        // add parameters to this method or create additional query methods with different names.
        // To support paging you will need to add ordering to the 'Sys_Users' query.
        public IQueryable<Sys_Users> GetSys_Users()
        {
            return this.ObjectContext.Sys_Users;
        }

        public void InsertSys_Users(Sys_Users sys_Users)
        {
            if ((sys_Users.EntityState != EntityState.Detached))
            {
                this.ObjectContext.ObjectStateManager.ChangeObjectState(sys_Users, EntityState.Added);
            }
            else
            {
                this.ObjectContext.Sys_Users.AddObject(sys_Users);
            }
        }

        public void UpdateSys_Users(Sys_Users currentSys_Users)
        {
            this.ObjectContext.Sys_Users.AttachAsModified(currentSys_Users, this.ChangeSet.GetOriginal(currentSys_Users));
        }

        public void DeleteSys_Users(Sys_Users sys_Users)
        {
            if ((sys_Users.EntityState == EntityState.Detached))
            {
                this.ObjectContext.Sys_Users.Attach(sys_Users);
            }
            this.ObjectContext.Sys_Users.DeleteObject(sys_Users);
        }
    }
}


